<!-- 题库管理-试卷管理-试卷组卷 -->
<div class="manageTitle">
	试卷管理-试卷组卷
</div>

<div class="content hasPb" ng-controller="examPaperManageGeneration">
	<div class="addBtn">
		<span class="title">试题类型</span>
		<div class="input-group m-b">
		    <div class="input-group-btn dropdown" dropdown="">
		        <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true"
		        aria-expanded="false">
		            {{nowTopicType.name}}
		            <span class="caret">
		            </span>
		        </button>
		        <ul class="dropdown-menu">
		            <li ng-repeat="item in topicType" ng-click="selectTopicType(item);">
		                <a href="javascript:;">
		                    {{item.name}}
		                </a>
		            </li>
		        </ul>
		    </div>
		</div>

		<a href="javascript:;" class="btnForClass" ng-click="addTopicType();">添加题型</a>
	</div>
	
	<!-- 添加题型 -->
	<div ng-repeat="item in topicListShow track by $index" ng-controller="topic">
		<div class="addBtn topicInfo">
			<span class="title">{{item.type.name}}</span>

			<span class="title">每题分值</span>
			<div class="input-group m-b">
			    <input type="number" class="numOfQuestion" min="0" ng-model="item.score" id="setPaperScore" ng-data="{{item.type}}" ng-change="changeScore(item.type,item.score);">
			</div>

			<a href="javascript:;" class="btnForClass" ng-click="addTopic(item.type);">添加试题</a>

			<span class="numOfTopic">
				已添加<span>{{item.list.length}}</span>道题
			</span>

			
			<a href="javascript:;" class="delete"><img src="../img/delete.png" ng-click="delAllType(item);"></a>
		</div>

		<div class="topic" ng-repeat="topic in item.list track by $index">
			<p class="title">{{$index+1}}、<span ng-bind-html="topic.title" class="hasP"></span>
				<a href="javascript:;" class="delete"><img src="../img/delete.png" ng-click="delTopic(topic);"></a>

				<a href="javascript:;" class="move moveUp"><img src="../img/moveUp.png" ng-data="{{topic.exercises_id}}" ng-click="moveUp(topic.exercises_id,$event);"></a>

				<a href="javascript:;" class="move"><img src="../img/moveDown.png" ng-data="{{topic.exercises_id}}" ng-click="moveDown(topic.exercises_id,$event);"></a>
			</p>
			<ol class="answer">
				<li ng-repeat="option in topic.opt" ng-bind-html="option.option_val"></li>
			</ol>
		</div>
	</div>

	<img src="../img/noData.png" class="noData" ng-if="noData">
	
	<div class="textAlignCenter hasmt" ng-if="!noData">
		<a ui-sref="fullScore.examPaperManage" class="baseBtn">保存</a>
	</div>
</div>

<!-- 添加试题 -->
<script type="text/ng-template" id="addTopic.html">
	<div class="panel-body newExamPaper">
	    <form class="form-horizontal border">
	    	<p class="title" ng-click="test();">添加试题<span ng-click="cancel();">&times;</span></p>
	    	
	    	<div class="content">
	    		<div class="addBtn">
	    			<span class="title">试题题型</span>
	    			<div class="input-group m-b">
	    			    <div class="input-group-btn dropdown" dropdown="">
	    			        <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true"
	    			        aria-expanded="false" style="border-radius: 6px;">
	    			            {{addTopicType.name}}
	    			        </button>
	    			    </div>
	    			</div>


	    			<span class="title">试卷所属分类</span>
	    			<div class="input-group m-b">
	    			    <div class="input-group-btn dropdown" dropdown="">
	    			        <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true"
	    			        aria-expanded="false">
	    			            {{themeArr.name}}
	    			            <span class="caret">
	    			            </span>
	    			        </button>
	    			        <ul class="dropdown-menu">
	    			            <li ng-repeat="item in relateList.themeArr" ng-click="selectThemeArr(item);">
	    			                <a href="javascript:;">
	    			                    {{item.name}}
	    			                </a>
	    			            </li>
	    			        </ul>
	    			    </div>
	    			</div>

	    			<span class="title">试卷所属章节</span>
	    			<div class="input-group m-b">
	    			    <div class="input-group-btn dropdown" dropdown="">
	    			        <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true"
	    			        aria-expanded="false">
	    			            {{chapterArr.name}}
	    			            <span class="caret">
	    			            </span>
	    			        </button>
	    			        <ul class="dropdown-menu">
	    			            <li ng-repeat="item in relateList.chapterArr" ng-click="selectChapterArr(item);">
	    			                <a href="javascript:;">
	    			                    {{item.name}}
	    			                </a>
	    			            </li>
	    			        </ul>
	    			    </div>
	    			</div>
	    		</div>
	    	</div>

	    	<table>
	    		<thead>
	    			<tr>
	    				<th class="checkboxTh">
	    					
	    				</th>
	    				<th class="IDTh">
	    					ID
	    				</th>
	    				<th class="thContent">题目内容</th>
	    			</tr>
	    		</thead>
	    		<tbody>
	    			<tr ng-repeat="item in listTopic" class="cursor" ng-click="selectTopic($event);">
	    				<td class="checkboxTh">
	    					<div class="checkbox">
	    					    <label class="i-checks i-checks-sm">
	    					        <input type="checkbox" ng-checked="item.isCheck">
	    					        <i></i>
	    					    </label>
	    					</div>
	    				</td>
	    				<td class="IDTh">
	    					{{item.id}}
	    				</td>
	    				<td ng-bind-html="item.title" class="thContent"></td>
	    			</tr>
	    			<tr ng-if="noData">
	    				<td colspan="3"><img src="../img/noData.png" class="height"></td>
	    			</tr>
	    		</tbody>
	    	</table>
	    </form>
	    <ul class="pagination"></ul>
	    <div class="btnDiv">
	    	<a href="javascript:;" class="baseBtn" ng-click="save();">添加</a>
	    	<a href="javascript:;" class="baseCancelBtn" ng-click="cancel();">取消</a>
	    </div>
	</div>
</script>